<template>
  <div class="view-register">
    <article v-if="registerLoginToken !== ''">
      <h2>恭喜你, 注册成功，请记住你的登录Token，用于以后的登录</h2>
      <p class="token-show">{{ registerLoginToken }}</p>
      <Button
        class="register-next-btn"
        type="primary"
        @click="handleNextClicked"
      >
        <Icon type="ios-go"></Icon>
        继续</Button
      >
    </article>
    <article v-else>
      <h2>注册失败!</h2>
    </article>
  </div>
</template>

<script lang="ts">
import { Component, Prop, Vue } from '@/plugins/class-component-hooks'

@Component({
  components: {}
})
export default class RegisterView extends Vue {
  @Prop({ default: '' }) registerLoginToken!: string

  handleNextClicked() {
    this.$router.push({ name: 'room-list' })
  }
}
</script>

<style lang="scss" scoped>
.view-register {
  margin: 0 auto;
  .token-show {
    color: dodgerblue;
    font-size: 3rem;
    font-weight: bold;
  }
}
</style>
